/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.hera.process.workflow.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.hera.base.domain.BaseDomain;

/**
 *
 * @author cmontes
 */
@Entity
@Table(name = "PROC_INSTANC_HISTORY")
public class ProcInstancHistory extends BaseDomain implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "ID_PROC_INSTANC_HISTORY")
    private Long idProcInstancHistory;
    @Basic(optional = false)
    @Column(name = "ID_STAGE")
    private Long idStage;
    @Column(name = "ID_DEPARTMENT")
    private Long idDepartment;
    private String name;
    @Column(name = "ID_TIMEUNIT")
    private Long idTimeunit;
    private String description;
    @Column(name = "TIME_AMOUNT")
    private Double timeAmount;
    @JoinColumn(name = "ID_PROCESS_INSTANCE", referencedColumnName = "ID_PROCESS_INSTANCE")
    @ManyToOne(optional = false)
    private ProcessInstance processInstance;

    public ProcInstancHistory() {
    }

    public ProcInstancHistory(Long idProcInstancHistory) {
        this.idProcInstancHistory = idProcInstancHistory;
    }

    public ProcInstancHistory(Long idProcInstancHistory, Long idStage) {
        this.idProcInstancHistory = idProcInstancHistory;
        this.idStage = idStage;
    }

    public Long getIdProcInstancHistory() {
        return idProcInstancHistory;
    }

    public void setIdProcInstancHistory(Long idProcInstancHistory) {
        this.idProcInstancHistory = idProcInstancHistory;
    }

    public Long getIdStage() {
        return idStage;
    }

    public void setIdStage(Long idStage) {
        this.idStage = idStage;
    }

    public Long getIdDepartment() {
        return idDepartment;
    }

    public void setIdDepartment(Long idDepartment) {
        this.idDepartment = idDepartment;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Long getIdTimeunit() {
        return idTimeunit;
    }

    public void setIdTimeunit(Long idTimeunit) {
        this.idTimeunit = idTimeunit;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Double getTimeAmount() {
        return timeAmount;
    }

    public void setTimeAmount(Double timeAmount) {
        this.timeAmount = timeAmount;
    }

    public ProcessInstance getProcessInstance() {
        return processInstance;
    }

    public void setProcessInstance(ProcessInstance processInstance) {
        this.processInstance = processInstance;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idProcInstancHistory != null ? idProcInstancHistory.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        
        if (!(object instanceof ProcInstancHistory)) {
            return false;
        }
        ProcInstancHistory other = (ProcInstancHistory) object;
        if ((this.idProcInstancHistory == null && other.idProcInstancHistory != null) || (this.idProcInstancHistory != null && !this.idProcInstancHistory.equals(other.idProcInstancHistory))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.hera.process.data.domain2.ProcInstancHistory[ idProcInstancHistory=" + idProcInstancHistory + " ]";
    }
    
}
